/**
 * @file
 * @author ruanairuo(ruanairuo@baijia.com)
 * @date 2020-01-07
 */
import React, {useEffect, useState} from 'react';
import {Row} from 'antd';
import {numberHandle, parsePercent} from '~/utils/number';
import CommonCard from '../../common/CommonCard';

export default function PartOneTextCard(props) {
    const {unitId, unitName, loading, data, onDownload, onDetail, format = numberHandle, span} = props;
    return (
        <CommonCard
            title={unitName}
            content={(
                <div className="wind-control-textarea">
                    {
                        data?.cardValues.map(item => format(item.value, 2))
                    }
                </div>
            )}
            span={span || 24}
            loading={loading}
            cardId={unitId}
            key={unitId}
            onDownload={onDownload}
            onDetail={onDetail}
            height={30}
        />
    );
}
